package com.ruoyi.common.enums;

import lombok.Data;

/**
 * 机构类型
 * 
 * @author ruoyi
 */

public enum MechanismType
{
    INTERNAL("0", "内设"), DISPATCH("2", "派出"),UNDER("1", "下设"), CAUSE("3", "事业");

    private final String code;
    private final String info;

    MechanismType(String code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public String getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }



    public static MechanismType mechanismTypeOf(String action) {
        for(MechanismType actionEnum : values()){
            if(actionEnum.getCode().equals(action)){
                return actionEnum;
            }
        }
        throw new RuntimeException("没有找到对应的枚举");
    }
}
